package com.piggy.logi.sys.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 结算方式枚举
 */
@Getter
@AllArgsConstructor
public enum SettleTypeEnum {

    cod(1, "现付"),

    pod(2, "到付"),

    poa(3, "欠付"),

    pom(4, "回单付"),

    ms(5, "月结"),

    mp(7, "混合付"),

    STATUS_UNKNOWN(-1, "未知状态"),

    ;

    private final int code;

    private final String info;

    public static SettleTypeEnum get(int code) {
        return Arrays.stream(values()).filter(t-> t.getCode()== code).findFirst().orElse(STATUS_UNKNOWN);
    }
}
